package com.db.transport;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.InetAddress;
import java.net.Socket;

import com.db.transport.client.SessionClient;
import com.db.transport.server.SessionServer;

public class SessionFactory {
	
	public static SessionClient getSessionClient(String clientID, InetAddress addressServer, int portServer) throws IOException {
		return new SessionClient(clientID, new Socket(addressServer, portServer));	
	}
	
	public static SessionClient getSessionClient(String clientID, Socket socket, BufferedReader reader, PrintWriter writer) {
		return new SessionClient(clientID, socket, reader, writer);
	}
	
	public static SessionServer getSessionServer(int portServer) throws IOException {
		return new SessionServer(portServer);
	}
	
}
